<!--查看追偿记录-->
<template>
  <div style="height: 100%;width: 100%;background-image:url('../../../assets/login/Recommend.jpg') ">
    <el-row align="middle">
      <h1 style="color:white;text-align: center;margin-top: 100px;margin-bottom: 50px;margin-left: auto">
        企业代偿记录</h1>
      <el-table
          :data="tableData"
          border
          style="width: 94.5%;margin: auto"
          :default-sort="{prop: 'date', order: 'descending'}"
          :highlight-current-row=true
      >
        <el-table-column
            prop="recourseTime"
            label="追偿时间"
            sortable
            width="320px">
        </el-table-column>
        <el-table-column
            prop="financeName"
            label="融资企业名"
            width="320px">
        </el-table-column>
        <el-table-column
            prop="assetsTrueValue"
            label="抵押资产价值"
            width="315px">
        </el-table-column>
        <el-table-column
            prop="compensationValue"
            label="代偿金额"
            width="315px">
        </el-table-column>
        <el-table-column
            prop="remainingAmount"
            label="剩余金额"
            width="315px">
        </el-table-column>
      </el-table>
      <!--      分页-->
      <el-col :span="8" :offset="8">
        <el-pagination
            background
            :page-sizes="[1, 2, 3, 4]"
            :page-size="pageSize"
            :current-page="pageNumber"
            layout="total, sizes,prev, pager, next"
            @prev-click="prevPage"
            @next-click="nextPage"
            @size-change="sizeChange"
            @current-change="currentChange"
            :total="total">
        </el-pagination>
      </el-col>


    </el-row>
  </div>
</template>

<script>
export default {
  data() {
    return {
      adminName: "",
      tableData: [],
      pageSize: 2,
      pageNumber: 1,
      total: 0,
    }
  },
  created() {
    this.adminName = sessionStorage.getItem('userName');
    this.queryList();
    var fuck = "|￣￣￣￣￣￣￣￣￣￣￣￣| \n" +
        "|                    |\n" +
        "|  Miao Miao Miao... |\n" +
        "|                    |\n" +
        "|                    |\n" +
        "|＿＿＿＿＿＿＿＿＿＿＿＿| \n" +
        "(\\__/) ||               \n" +
        "(•ㅅ•) ||               \n" +
        "/ 　 づv               "
    console.log(fuck);
  },
  methods: {
    queryList() {
      let request = {};
      request.pageNum = this.pageNumber;
      request.pageSize = this.pageSize;
      request.data = this.adminName;
      this.$axios.post('api/recourse/check', request, {headers: {'jwt': localStorage.getItem('jwt')}})
          .then(res => {
            let pageData = res.data.data;
            this.tableData = pageData.list;
            this.pageNumber = pageData.pageNum;
            this.pageSize = pageData.pageSize;
            this.total = pageData.total;
          })
    },
    prevPage(val) {
      this.pageNumber = val
      this.queryList()
    },
    nextPage(val) {
      this.pageNumber = val
      this.queryList()
    },
    sizeChange(val) {
      this.pageSize = val
      this.pageNumber = 1;
      this.queryList()
    },
    currentChange(val) {
      this.pageNumber = val
      this.queryList()
    },
  }
}
</script>
<style>
.el-row {
  background-image: url("../../../assets/login/Recommend.jpg");
  background-size: 100% 100%;
  height: 100%;
}
</style>
